package com.farben.system.service.impl;

import java.util.List;

import com.farben.common.core.domain.model.LoginUser;
import com.farben.common.utils.SecurityUtils;
import com.farben.system.domain.AgingDesignUserAppLink;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.farben.system.mapper.AgingDesignAppInfoMapper;
import com.farben.system.domain.AgingDesignAppInfo;
import com.farben.system.service.IAgingDesignAppInfoService;

/**
 * 后管应用信息Service业务层处理
 * 
 * @author farben
 * @date 2023-05-16
 */
@Service
public class AgingDesignAppInfoServiceImpl implements IAgingDesignAppInfoService
{
    @Autowired
    private AgingDesignAppInfoMapper agingDesignAppInfoMapper;

    /**
     * 查询后管应用信息
     * 
     * @param id 后管应用信息ID
     * @return 后管应用信息
     */
    @Override
    public AgingDesignAppInfo selectAgingDesignAppInfoById(Long id)
    {
        return agingDesignAppInfoMapper.selectAgingDesignAppInfoById(id);
    }

    /**
     * 查询后管应用信息列表
     * 
     * @param agingDesignAppInfo 后管应用信息
     * @return 后管应用信息
     */
    @Override
    public List<AgingDesignAppInfo> selectAgingDesignAppInfoList(AgingDesignAppInfo agingDesignAppInfo)
    {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        agingDesignAppInfo.setUserId(loginUser.getUsername());
        return agingDesignAppInfoMapper.selectAgingDesignAppInfoList(agingDesignAppInfo);
    }

    /**
     * 新增后管应用信息
     *
     * @param agingDesignUserAppLink 后管用户应用关联信息
     * @return 结果
     */
    @Override
    public int insertAgingDesignUserAppLink(AgingDesignUserAppLink agingDesignUserAppLink)
    {
        return agingDesignAppInfoMapper.insertAgingDesignUserAppLink(agingDesignUserAppLink);
    }

    /**
     * 新增后管应用信息
     * 
     * @param agingDesignAppInfo 后管应用信息
     * @return 结果
     */
    @Override
    public int insertAgingDesignAppInfo(AgingDesignAppInfo agingDesignAppInfo)
    {
        return agingDesignAppInfoMapper.insertAgingDesignAppInfo(agingDesignAppInfo);
    }

    /**
     * 修改后管应用信息
     * 
     * @param agingDesignAppInfo 后管应用信息
     * @return 结果
     */
    @Override
    public int updateAgingDesignAppInfo(AgingDesignAppInfo agingDesignAppInfo)
    {
        return agingDesignAppInfoMapper.updateAgingDesignAppInfo(agingDesignAppInfo);
    }

    /**
     * 批量删除后管应用信息
     * 
     * @param ids 需要删除的后管应用信息ID
     * @return 结果
     */
    @Override
    public int deleteAgingDesignAppInfoByIds(Long[] ids)
    {
        return agingDesignAppInfoMapper.deleteAgingDesignAppInfoByIds(ids);
    }

    /**
     * 删除后管应用信息信息
     * 
     * @param id 后管应用信息ID
     * @return 结果
     */
    @Override
    public int deleteAgingDesignAppInfoById(Long id)
    {
        return agingDesignAppInfoMapper.deleteAgingDesignAppInfoById(id);
    }
}
